home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group92c.txt / 000031_icon-group-sender _Wed Oct 21 17:54:16 1992.msg < prev    next >
Internet Message Format  |  1993-01-04  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Thu, 22 Oct 1992 05:59:49 MST
  2. From: mitch@rock.csd.sgi.com
  3. Date: Wed, 21 Oct 92 17:54:16 -0700
  4. Original-From: mitch@rock.csd.sgi.com (Tom Mitchell)
  5. Message-Id: <9210220054.AA02378@rock.csd.sgi.com>
  6. To: nowlin@iwtqg.att.com
  7. Cc: att!cs.arizona.edu!icon-group
  8. In-Reply-To: nowlin@iwtqg.att.com's message of Tue, 20 Oct 92 12:05 CDT <199210201711.AA23991@optima.cs.arizona.edu>
  9. Subject: logging off UNIX
  10. Status: R
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12.  
  13.  
  14.    From: nowlin@iwtqg.att.com
  15.    Date: Tue, 20 Oct 92 12:05 CDT
  16.  
  17.     > You could get around this a) by finding your login shell and then
  18.     > killing it manually (a la system("kill -9 "||process_id) where pro-
  19.     > cess_id is the ID of your login shell.
  20.  
  21.    I can't take it anymore.  One of the first things UNIX novices learn is how
  22.    to do a "kill -9".  Most haven't a clue what this does but believe me -
  23.    it's not a pretty sight.
  24.  
  25. Yes,  this is not a pretty sight.  The man page used to
  26. say "kill with extreme prejudice".  
  27.  
  28. On most Unix systems kill and killall send a -9 by default.
  29. This is gross and nasty.  Lots of people alias such things
  30. to "kill -HUP $* ; sleep 5; kill $*" to give the poor
  31. process 5 seconds to correctly clean up its TMP files
  32. network connections and so on...
  33.  
  34. I like to think that the HUP signal is the best thing that
  35. the phone company could do when a phone line hangs up.  With
  36. older modems and phone lines -- this was common enough that
  37. older programs do good things in the presence of a HUP
  38. signal.
  39.  
  40. Too often new programmers omit signal handlers where signals
  41. can be used to turn on debug; exit gracefully; reset strange
  42. states; and so on.
  43.  
  44.    If you have to kill a process use a plain vanilla "kill" first.  This uses
  45.    the software termination signal (15) to notify the process in question it
  46.    should terminate.  This signal gives the process being killed a chance to
  47.    return any resources it's using and clean up after itself before it dies.
  48.    -----
  49.    a kinder gentler UNIX.
  50.  
  51.    Jerry Nowlin
  52.  
  53. Good stuff Jerry... Exactly,  
  54.  
  55.  
  56.  
  57.  
  58.